package logic

import (
	"context"
	"onerk4/zg5yk/ordering/common/proto/user"
	"onerk4/zg5yk/ordering/service/server"
)

type UserServer struct {
	user.UnimplementedUserServer
}

func (u UserServer) UserLogin(ctx context.Context, req *user.UserLoginRequest) (*user.UserLoginResponse, error) {
	login, err := server.UserLogin(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserServer) ReceiveCoupon(ctx context.Context, req *user.ReceiveCouponRequest) (*user.ReceiveCouponResponse, error) {
	login, err := server.ReceiveCoupon(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}

func (u UserServer) ShowCoupon(ctx context.Context, req *user.ShowCouponRequest) (*user.ShowCouponResponse, error) {
	login, err := server.ShowCoupon(req)
	if err != nil {
		return nil, err
	}
	return login, nil
}
